﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace Common
{
    public class DonHang
    {
        public int iDonHang_ID { get; set; }
        public int iThanhVien_ID { get; set; }
        public DateTime dNgayTao { get; set; }
        public string sMoTa { get; set; }
        public bool bDaDuyet { get; set; }
        public DonHang()
        {

        }
        public DonHang(SqlDataReader reader)
        {
            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) this.iDonHang_ID = Convert.ToInt32(reader["iDonHang_ID"]);
                if (!reader.IsDBNull(1)) this.iThanhVien_ID = Convert.ToInt32(reader["iThanhVien_ID"]);
                if (!reader.IsDBNull(2)) this.dNgayTao = Convert.ToDateTime(reader["dNgayTao"]);
                if (!reader.IsDBNull(3)) this.sMoTa = reader["sMoTa"].ToString();
                if (!reader.IsDBNull(4)) this.bDaDuyet = Convert.ToBoolean(reader["bDaDuyet"]);
            }
            reader.Close();
            reader.Dispose();
        }
    }
}
